﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Jäckvik_Grupp4
{
    public partial class Searchresult : Form
    {
        Skishop skishop;
        private LOGIC.LogicPrivateGuest privateGuest = new LOGIC.LogicPrivateGuest();
        private LOGIC.LogicCompanyGuest companyGuest = new LOGIC.LogicCompanyGuest();

        private string tempFName;
        private string tempLName;
        private string tempAddress;
        private int tempZip;
        private string tempCity;
        private string tempCoName;
        private string tempOrgNr;
        private string tempCoRef;


        public Searchresult(Skishop s)
        {
            InitializeComponent();
            skishop = s;

            //if (skishop.SelectedTab == 0)
            //{ PrivateGuestSearch(); }
            //else
            //{ CompanyGuestSearch(); }
        }

        public Searchresult()
        { }
        
        public string TempFName
        {
            get { return tempFName; } set { tempFName = value; }
        }
        public string TempLName
        {
            get { return tempLName; } set { tempLName = value; }
        }
        public string TempAddress
        {
            get { return tempAddress; } set { tempAddress = value; }
        }
        public int TempZip
        {
            get { return tempZip; } set { tempZip = value; }
        }
        public string TempCity
        {
            get { return tempCity; } set { tempCity = value; }
        }

        public string TempCoName
        {
            get { return tempCoName; } set { tempCoName = value; }
        }

        public string TempOrgNr
        {
            get { return tempOrgNr; } set { tempOrgNr = value; }
        }

        public string TempCoRef
        {
            get { return tempCoRef; } set { tempCoRef = value; }
        }


        //private void PrivateGuestSearch()
        //{
        //    dataGridViewCoGuestSearch.Visible = false;
        //    dataGridViewPGuestSearch.Visible = true;
        //    if (e != "" && this.tempLName != "")
        //    {
        //        this.tempLName = skishop.GetGuestLastName;
        //        this.tempFName = skishop.GetGuestFirstName;
        //        dataGridViewPGuestSearch.DataSource = privateGuest.GetGuestByName(tempLName, tempFName);
        //    }
        //    else if (this.tempFName != "")
        //    {
        //        this.tempFName = skishop.GetGuestFirstName;
        //        dataGridViewPGuestSearch.DataSource = privateGuest.GetGuestByFName(tempFName);
        //    }

        //    else
        //    {
        //        this.tempLName = skishop.GetGuestLastName;
        //        dataGridViewPGuestSearch.DataSource = privateGuest.GetGuestByLName(tempLName);
        //    }
        //}

        //private void CompanyGuestSearch()
        //{
        //    dataGridViewCoGuestSearch.Visible = true;
        //    dataGridViewPGuestSearch.Visible = false;
        //    if (this.tempOrgNr != "")
        //    {
        //        this.tempOrgNr = skishop.GetCoGuestOrgNr;
        //        dataGridViewCoGuestSearch.DataSource = companyGuest.GetCoGuestOrgNr(tempOrgNr);
        //    }
 
        //}

        //private void GetGuestFirstName()
        //{
        //    tempFName = dataGridViewPGuestSearch.CurrentRow.Cells[0].Value.ToString();
        //}

        //private void GetGuestLastName()
        //{
        //    tempLName = dataGridViewPGuestSearch.CurrentRow.Cells[1].Value.ToString();
        //}

        //private void GetGuestAddress()
        //{
        //    tempAddress = dataGridViewPGuestSearch.CurrentRow.Cells[2].Value.ToString();
        //}

        //private void GetGuestZip()
        //{
        //    tempZip = int.Parse(dataGridViewPGuestSearch.CurrentRow.Cells[3].Value.ToString());
        //}

        //private void GetGuestCity()
        //{
        //    tempCity = dataGridViewPGuestSearch.CurrentRow.Cells[4].Value.ToString();
        //}

        //private void button_SearchChoose_Click_1(object sender, EventArgs e)
        //{
        //    if (dataGridViewPGuestSearch.CurrentRow.Visible)
        //    {
        //        GetGuestFirstName();
        //        GetGuestLastName();
        //        GetGuestAddress();
        //        GetGuestZip();
        //        GetGuestCity();
        //        this.Close();
        //    }
        //    else if (dataGridViewCoGuestSearch.CurrentRow.Visible)
        //    {
        //        GetGuestAddress();
 
        //    }
            
           
        //}

        //private void button_SearchCancel_Click_1(object sender, EventArgs e)
        //{
        //    this.Close();
        //}

    }
}
